#ifndef CLIENT_H
#define CLIENT_H

#include <xmmsclient/xmmsclient++.h>
#include <discid/discid.h>
#include <iostream>
#include <cstdlib>
#include <sys/stat.h>
#include <string>
#include <list>

#include "discinfo.h"
#include "cfg.h"
#include "proto.h"
#include "ui.h"

class XmmsCdinfo
{
	public:
		XmmsCdinfo();
		int main(int, char**);
		~XmmsCdinfo();

		void registerProto(Proto* proto);
		void unregisterProto(Proto* proto);

		Ui* const getUI();
		const std::string getPath();

		bool xmmsUpdate(const disc_t& disc);
		bool getDiscInfo(disc_t&);
	
	protected:
		bool xmmsConfigCallback(const Xmms::Dict& info);
		bool xmmsEntryCallback(const unsigned int& id);
		bool xmmsUpdateCallback(const Xmms::Dict& info);
		bool xmmsCallbackNull();
		bool xmmsCallbackError(const std::string& error);

	private:
		std::string path;
		std::string cddev;

		Xmms::Client client;
		Cfg cfg;
		Ui* ui;
		std::list<Proto*> registry;

		bool xmmsConnect();
		void setDefaultCfg();
};

extern XmmsCdinfo app;

#endif /* CLIENT_H */
